package spring.listener;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import spring.event.RandomEvent;

/**
 * @author huu
 * @create 2025-08-25-14:41
 */
@Component
public class RandomListener {

    //实现一个onEvent方法告诉这是一个监听器
    @EventListener
    public void onRandomEvent(RandomEvent event)
    {
        System.out.println("RandomListener: " + event.getSource());
    }
}
